<template>
<v-touch @swipeleft ="hui" @swiperight="hui">
  <div class="theme">
      <div class="top">
        <div class="hui" @click="hui"></div>
        <div class="txt">
          <h3>主题与显示</h3>
        </div>
      </div>
      <div class="cont">
        <h4>主题模式</h4>
        <div class="color">
          <div @click="ck(0)">
            <label>
              <div class="green"></div>
              <input type="radio" name="color" checked>浅绿色
            </label>
          </div>
          <div  @click="ck(1)">
            <label>
              <div class="blue"></div>
              <input type="radio" name="color">浅蓝色
            </label>
          </div>
          <div  @click="ck(2)">
            <label>
              <div class="gray"></div>
              <input type="radio" name="color">浅灰色
            </label>
          </div>
        </div>
      </div>
  </div>
</v-touch>
</template>
<script>

export default {
  data(){
    return {
      colors:['lightGreen','lightBlue','lightGray'],
    }
  },
  methods:{  
    hui(){
      this.$router.back()
    },
    ck(i){
      this.$store.commit('color',this.colors[i])

    }
  }
}
</script>
<style lang="scss" scoped>
  .theme {
    width: 100vw;
    height: 100vh;
    .top {
      padding: 20px;
      width: 100%;
      display: flex;
      border-bottom: 1px solid rgb(237, 237, 237);
      // justify-content: center;
      align-items: center;
      // justify-self: start;
      .hui {
        width: 15px;
        height: 15px;
        border-left:2px solid rgb(0, 0, 0);
        border-top:2px solid rgb(0, 0, 0) ;
        transform: rotate(-45deg) scale(.8);
      }
      .txt {
        flex-grow: 1;
        text-align: center;
      }
    }
    .cont {
      width: 100%;
      padding: 20px;
      .color {
        width: 100%;
        display: flex;
        justify-content: space-between;
        margin-top: 10px;
        div {
          width: 100%;
          text-align: center;
          margin-right: 10px;
          div {
            width: 100%;
            height: 70px;
            border-radius: 8px;
            // background: gray;
            margin-bottom: 10px ;
          }
          .green {
            background: #36C1BB;
          }
          .blue {
            background: rgb(95, 135, 237);
          }
          .gray {
            background: rgb(186, 185, 185);
          }
        }
      }
    }
  }
</style>